import type { RouteConfig } from '../../typings/router';
import orgController from '../controllers/org';

/**
 * 组织模块路由
 */
const orgRoutes: RouteConfig[] = [
    {
        method: 'get',
        name: 'orgRetrieve',
        path: '/org/retrieve',
        middlewares: [orgController.retrieveAction],
    },
    {
        method: 'post',
        name: 'orgAdd',
        path: '/org/add',
        middlewares: [orgController.addAction],
    },
    {
        method: 'put',
        name: 'orgUpdate',
        path: '/org/update',
        middlewares: [orgController.updateAction],
    },
    {
        method: 'delete',
        name: 'orgDelete',
        path: '/org/delete',
        middlewares: [orgController.deleteAction],
    },
    {
        method: 'get',
        name: 'orgTreeScope',
        path: '/org/treeScope',
        middlewares: [orgController.treeScopeAction],
    },
    {
        method: 'get',
        name: 'orgTree',
        path: '/org/tree',
        middlewares: [orgController.treeAction],
    },
];

export default orgRoutes;
